home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / UQWK.ZIP;1 / UQWKP12.TAR / uqwk.patch2 < prev   
Encoding:
Text File  |  1993-03-28  |  2.5 KB  |  113 lines

  1. Submitted-by: seb3@gte.com (Steve Belczyk)
  2. Posting-number: Volume 36, Issue 70
  3. Archive-name: uqwk/patch02
  4. Environment: UNIX
  5. Patch-To: uqwk, Volume 36, Issue 8
  6.  
  7. This patch updates uqwk 1.1 to uqwk 1.2.  This fixes a pretty nasty
  8. bug reading some .newsrc files.  Thanks to James Dehnert and Eric J.
  9. Nihill for helping to track this one down.  Also, I apologize to
  10. Russell Schulz for misspelling his name in an earlier posting.
  11.  
  12. cd into the uqwk source directory and "patch -p1 < this-file"
  13.  
  14. diff -c uqwk1.1/news.c uqwk1.2/news.c
  15. *** uqwk1.1/news.c    Thu Mar 18 10:28:56 1993
  16. --- uqwk1.2/news.c    Mon Mar 22 13:59:36 1993
  17. ***************
  18. *** 49,55 ****
  19.   {
  20.       char group_name[PATH_LEN];
  21.       struct nrc_ent *np;
  22. !     int n, c;
  23.   
  24.       /* Don't bother if we've alread read it */
  25.       if (nrc_list != NULL) return (1);
  26. --- 49,55 ----
  27.   {
  28.       char group_name[PATH_LEN];
  29.       struct nrc_ent *np;
  30. !     int i, n, c;
  31.   
  32.       /* Don't bother if we've alread read it */
  33.       if (nrc_list != NULL) return (1);
  34. ***************
  35. *** 68,88 ****
  36.           np = (struct nrc_ent *) malloc (sizeof (struct nrc_ent));
  37.           if (np == NULL) OutOfMemory();
  38.   
  39.           /* Parse group name */
  40.           sscanf (buf, "%s", group_name);
  41.           n = strlen (group_name);
  42.   
  43. !         if (group_name[n-1] == ':')
  44. !         {
  45. !             np->subscribed = 1;
  46. !         }
  47. !         else
  48. !         {
  49. !             np->subscribed = 0;
  50. !         }
  51. !         group_name[n-1] = 0;
  52. !         np->name = (char *) malloc (n);
  53.           if (np->name == NULL) OutOfMemory();
  54.           strcpy (np->name, group_name);
  55.   
  56. --- 68,97 ----
  57.           np = (struct nrc_ent *) malloc (sizeof (struct nrc_ent));
  58.           if (np == NULL) OutOfMemory();
  59.   
  60. +         /* Assume not subscribed */
  61. +         np->subscribed = 0;
  62.           /* Parse group name */
  63. +         n = strlen (buf);
  64. +         for (i=0; i<n; i++)
  65. +         {
  66. +             /* Some .newsrc lines don't have a space after the
  67. +                newsgroup name, so we kludge it like this */
  68. +             if (buf[i] == ':')
  69. +             {
  70. +                 np->subscribed = 1;
  71. +                 buf[i] = ' ';
  72. +             }
  73. +             if (buf[i] == '!')
  74. +             {
  75. +                 np->subscribed = 0;
  76. +                 buf[i] = ' ';
  77. +             }
  78. +         }
  79.           sscanf (buf, "%s", group_name);
  80.           n = strlen (group_name);
  81.   
  82. !         np->name = (char *) malloc (n+1);
  83.           if (np->name == NULL) OutOfMemory();
  84.           strcpy (np->name, group_name);
  85.   
  86. diff -c uqwk1.1/uqwk.h uqwk1.2/uqwk.h
  87. *** uqwk1.1/uqwk.h    Thu Mar 18 10:37:51 1993
  88. --- uqwk1.2/uqwk.h    Mon Mar 22 13:53:54 1993
  89. ***************
  90. *** 2,8 ****
  91.    *  Header for uqwk
  92.    */
  93.   
  94. ! #define UQWK_VERSION    "1.1"
  95.   
  96.   #ifdef ALLOCATE
  97.   #define EXTERN
  98. --- 2,8 ----
  99.    *  Header for uqwk
  100.    */
  101.   
  102. ! #define UQWK_VERSION    "1.2"
  103.   
  104.   #ifdef ALLOCATE
  105.   #define EXTERN
  106.  
  107.  
  108. exit 0 # Just in case...
  109.  
  110.  
  111.